package com.mtolstykh.data;

import java.util.Date;

import com.mtolstykh.utils.Utils;

public class Entity {
	private String 	id;	
	private Long 	creationDate;
	protected String 	name;
	
	public Entity() {		
		this.creationDate = new Date().getTime();
		this.id = Utils.md5sum(String.valueOf(this.creationDate));
	}
	
	public Entity(String name) {
		this.id = String.valueOf(this.creationDate) + Utils.md5sum(this.name);
	}
	
	public void setId(String id) {
		this.id = id;
	}
	
	public String getId() {
		return id;
	}
	
	public String getTitle() {
		return name;
	}
	
	public void setTitle(String title) {
		this.name = title;
	}		
	
	public void setCreationDate(Long creationDate) {
		this.creationDate = creationDate;
	}
	
	public Long getCreationDate() {
		return creationDate;
	}
}
